import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Dialog-对话框',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Dialog-对话框'),
        ),
        body: DemoPage(),
      ),
    );
  }
}

class DemoPage extends StatefulWidget{
  @override
  DemoPageState createState() => DemoPageState();
}

class DemoPageState extends State{

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          color: Colors.grey,
          height: 500,
          child: GridView.count(
            //列的个数
            crossAxisCount: 2,
          //垂直空隙
          mainAxisSpacing: 10,
            //水平空隙
            crossAxisSpacing: 4,
            //内边距
            padding: EdgeInsets.all(4),
            children: [
              //基本用法
              GridTile(child: Icon(Icons.add),header: Text('header'),footer: Text('footer'),),
              //
              GridTile(child: Icon(Icons.add),
                header: GridTileBar(title: Text('title'),subtitle: Text('subtitle'),leading: Icon(Icons.add),),
                footer: Text('footer'),),
              //网格
              GridPaper(
                color: Colors.red,
                child:  Icon(Icons.add),
              ),
              Icon(Icons.add),
            ],
          ),
        )
      ],
    );
  }
}